package com.demo.blog;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;

/**
 * BlogInterceptor
 * 此拦截器仅做为示例展示，在本 demo 中并不需要
 */
public class BlogInterceptor implements Interceptor {

	public Object intercept(Invocation inv) {
		System.out.println("\nBefore invoking------------- " + inv.getMethod().getName());
		long start = System.currentTimeMillis();
		Object returnValue = inv.invoke();
		System.out.println("用时：" + (System.currentTimeMillis() - start) + "ms");
		System.out.println("After invoking-------------- " + inv.getMethod().getName());
		return returnValue;
	}
}
